package ca.ets.osgi.conferenceroomservice;

/**
 * Represent a room
 * @author HP_Administrator
 *
 */
public class Room {
	
	private String name;
	private String surface;
	private boolean isProjectorAvailable = false;
	
	
	public Room(){}


	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}


	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


	/**
	 * @return the surface
	 */
	public String getSurface() {
		return surface;
	}


	/**
	 * @param surface the surface to set
	 */
	public void setSurface(String surface) {
		this.surface = surface;
	}


	/**
	 * @return the isProjectorAvailable
	 */
	public boolean isProjectorAvailable() {
		return isProjectorAvailable;
	}


	/**
	 * @param isProjectorAvailable the isProjectorAvailable to set
	 */
	public void setProjectorAvailable(boolean isProjectorAvailable) {
		this.isProjectorAvailable = isProjectorAvailable;
	}
	
	/**
	 * 
	 */
	public void setProjectorToOff(){
		this.isProjectorAvailable =false;
	}
	
	/**
	 * 
	 */
	public void setProjectorToOn(){
		this.isProjectorAvailable =true;
	}
	
	/**
	 * Indicates if the parameters equals to this room
	 * @param roomID2
	 * @param surface2
	 * @param projector
	 * @return
	 */
	public boolean isRoom1EqualtoRoom2(String roomID2, String surface2, boolean projector){
		boolean response = false;
		if(this.getName().equalsIgnoreCase(roomID2) && this.getSurface().equalsIgnoreCase(surface2) && this.isProjectorAvailable() == projector){
			response =true;
		}
		
		return response;
	}
	
	/**
	 * Indicates if the parameters equals to this room
	 * @param roomID2
	 * @param surface2
	 * @param projector
	 * @return
	 */
	public boolean isRoom1EqualtoRoom2(String surface2, boolean projector){
		boolean response = false;
		if(this.getSurface().equalsIgnoreCase(surface2) && this.isProjectorAvailable() == projector){
			response =true;
		}
		
		return response;
	}

	public String toString(){
		return "Room " + this.getName() + "," + "with Surface " + this.getSurface() + " ,is Projector available " + this.isProjectorAvailable();  
	}
}
